package com.resjz.milddog.controller;


import com.purgeteam.cloud.dispose.starter.Result;
import com.resjz.milddog.service.dept.DeptService;
import com.resjz.milddog.service.user.UserService;
import com.resjz.milddog.vo.dept.DeptVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;


@RestController
@Slf4j
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    private DeptService deptService;
    @PostMapping(value = "/getArr")
    public Result getArr() {
        return Result.ofSuccess(deptService.getDeptArr()) ;
    }
    @PostMapping(value = "/addDept")
    public Result addDept(@RequestBody DeptVo dept) {
        return deptService.addSave(dept);
    }
    @PostMapping(value = "/delDept")
    public Result delDept(Long deptId) {
        return deptService.delDept(deptId);
    }
}
